//路径转化
const getImageBase64_readFile = (tempFilePath)=>{
  return  new Promise(resolve => {
    //获取全局唯一的文件管理器
    wx.getFileSystemManager()
      .readFile({ //读取本地文件内容
        filePath: tempFilePath, // 文件路径
        encoding: 'base64', // 返回格式
        success: ({data}) => {
          return resolve('data:image/png;base64,' + data);
        },
        fail(res) {
          console.log('fail', res)
        }
      });
  });

}

export { getImageBase64_readFile };
